<template>
  <BaseModal ref="modalRef" @on-modal-cancel="modalCancel" @on-modal-ok="modalOK">
    <template #titleArea>设计工具 </template>
    <template #contentArea>
      <div class="item-box flex-box">
        <!-- v-if="list && list.length > 0" v-for="item in list" :key="item.id" -->
        <div class="item-view">
          <p class="time-view">
            <i class="el-icon-alarm-clock"></i>
            剩余小时
            <!-- {{ (item.residueTiming / 60).toFixed(2) }} -->
          </p>
          <div class="design-info">
            <div class="img-view">
              <div style="width: 60px; height: 60px"></div>
            </div>
            <p class="name-view">
              <span class="applic-view-name">测试</span>
              <!-- {{ item.name }} -->
            </p>
          </div>
          <div class="flex-box but-group">
            <p class="open-btn">打开</p>
          </div>
        </div>
        <!-- 占位符 -->
        <div class="item-view view-hidden"></div>
        <div class="item-view view-hidden"></div>
        <div class="item-view view-hidden"></div>
        <div class="item-view view-hidden"></div>
        <div class="item-view view-hidden"></div>
      </div>
    </template>
  </BaseModal>
</template>

<script setup lang="ts">
import { defineProps } from "vue"
import onRenew from "@/components/Business/XTModuleFormEDA/XTModuleEDAApplyCost.vue"
import BaseModal from "@/components/Basics/BaseModal.vue"
const modalRef = ref()
const showModal = (): void => {
  modalRef.value.setOpen()
}
const modalOK = () => {
  modalRef.value.setCloes()
}
const modalCancel = () => {
  modalRef.value.setCloes()
}
defineExpose({
  showModal,
})
onMounted(() => {
  // console.log(prop.btnList)
})

const activeKey = ref("1")
const activeNum = ref(1)
/*窗口点击改变事件*/
const changeFun = () => {
  console.log(activeKey)
}
const columns = reactive([
  { title: "会话Id", dataIndex: "id", key: "id" },
  { title: "会话名", dataIndex: "name", key: "name" },
  { title: "会话所属者", dataIndex: "owner", key: "owner" },
  { title: "状态", dataIndex: "statusText", key: "statusText" },
  { title: "所有者", dataIndex: "owner", key: "owner" },
  { title: "操作系统", dataIndex: "os", key: "os" },
  { title: "是否共享", dataIndex: "isShareText", key: "isShareText" },
  { title: "执行节点", dataIndex: "host", key: "host" },
  { title: "启动模式", dataIndex: "startmode", key: "startmode" },
  { title: "启动时间", dataIndex: "createDate", key: "createDate" },
  { title: "运行时长", dataIndex: "runTime", key: "runTime" },
  { title: "空闲时间", dataIndex: "freeTime", key: "freeTime" },
  { title: "操作", dataIndex: "action", align: "center", width: 240, fixed: "right" },
])
const tableData = reactive([])
const onDetails = row => {
  console.log(row)
}
defineProps({
  list: {
    type: Array,
    default: () => [],
  },
})
</script>
<style scoped lang="less">
.contents-list {
  flex: 1 1 50%;
  padding: 0 10px;
  border-right: 1px solid #e8e8e8;
  .layout-checklist__title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.47;
  }
  .layout-checklist-list {
    // overflow-y: scroll;
    max-height: 40vh;
    &::-webkit-scrollbar {
      width: 0;
    }
  }
}
.contents-checked {
  flex: 1 1 50%;
  padding: 0px 10px;
  .layout-checklist__title {
    .layout-checklist__title_span {
      color: #909090;
    }
  }
  .layout-checklist-list {
    // overflow-y: scroll;
    max-height: 40vh;

    &::-webkit-scrollbar {
      width: 0;
    }
  }
}
</style>
<style scoped>
:deep(.ant-checkbox-wrapper) {
  display: flex;
  margin-left: 0;
}
</style>
<style scoped lang="less">
.item-box {
  padding: 0 30px;
  justify-content: space-between;
  flex-wrap: wrap;
  .view-hidden {
    visibility: hidden;
  }
  .item-view {
    position: relative;
    .time-view {
      position: relative;
      top: -4px;
      text-align: left;
      text-indent: 7px;
    }
    margin: 10px;
    height: 255px;
    width: 210px;
    border: 1px solid rgb(102, 102, 102);
    padding: 10px 0;
    text-align: center;
    color: orange;
    cursor: pointer;
    box-sizing: border-box;
    border-top: 4px solid rgb(102, 102, 102);
    transition: box-shadow 0.5s;
    &:hover {
      box-shadow: rgb(0 0 0 / 10%) 0px 2px 12px 0px;
      // background: #eee;
    }
    .design-info {
      position: relative;
      height: 180px;
      p {
        padding: 10px 0;
        box-sizing: border-box;
      }
      span {
        color: black;
        font-weight: bold;
      }
    }
    .but-group {
      justify-content: space-around;
      p {
        display: inline-block;
        width: 65px;
        height: 28px;
        line-height: 28px;
        border-radius: 5px;
        color: #fff;
        box-sizing: border-box;
        font-size: 12px;
        cursor: pointer;
        &.renew-btn {
          background-color: #f95f02;
          transition: background 0.5s;
          &:hover {
            background: #e43b3b;
          }
        }
        &.open-btn {
          background-color: #0255c8;
          transition: background 0.5s;
          &:hover {
            background: #0a6bf1;
          }
        }
      }
    }
  }
}
</style>
